package com.alan.libapi.model.business;

/**
 * @className: TcpJsonRequest
 * @describtion: TcpJsonRequest
 * @author: AlanWang
 * @email: 850267876@qq.com
 * @time: 2016/4/27 23:44
 */
public class TcpJsonRequest<T> {

    /**
     * jsonrpc版本
     */
    public static final String JSON_RPCVERSION_VALUE = "1.0";

    private String jsonrpc;
    private String method;
    private T params;
    private int id;

    public TcpJsonRequest() {
    }

    public TcpJsonRequest(int id, String method, T params) {
        this.jsonrpc = JSON_RPCVERSION_VALUE;
        this.id = id;
        this.method = method;
        this.params = params;
    }

    public T getParams() {
        return params;
    }

    public void setParams(T params) {
        this.params = params;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getJsonrpc() {
        return jsonrpc;
    }

    public void setJsonrpc(String jsonrpc) {
        this.jsonrpc = jsonrpc;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    @Override
    public String toString() {
        return "TcpJsonRequest{" +
                "id=" + id +
                ", jsonrpc='" + jsonrpc + '\'' +
                ", method='" + method + '\'' +
                ", params=" + params +
                '}';
    }
}
